/*
 * @Author: 张宇捷
 * @Date: 2025-10-09 16:16:49
 * @LastEditors: 张宇捷
 * @LastEditTime: 2025-10-17 16:52:30
 * @Description: 文件描述
 */
import React from "react";
import ReactDOM from "react-dom/client";
import "@/index.less";
import { render, createElement } from "./jsxHandler";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <>
    {/* 需求，没有数组，单纯循环五次获取五个按钮 */}
    {new Array(5).fill(null).map((_, index) => {
      return <button key={index}>按钮{index + 1}</button>;
    })}
    {}
  </>
);

let x = 10;
const virtualDOM = createElement(
  'div',
  null,
  "这是一串文本",
  "这是另一串文本",
  createElement("h2", null, "Hello World"),
  createElement(
    "div",
    { className: "box" },
    createElement("span", null, x)
  )
);
console.log(virtualDOM);
render(virtualDOM, document.getElementById("root"));
console.log(createElement("button", null, "按钮1"));




// 代理proxy
fetch("/jian/subscriptions/recommended_collections")
  .then((res) => res.json())
  .then((data) => {
    // console.log(data);
  });
fetch("/zhi/news/latest")
  .then((res) => res.json())
  .then((data) => {
    // console.log(data);
  });